<?php
/**
 * Created by PhpStorm
 * USER:  Zhaoys
 * Date:  2024/3/11
 */

namespace App\Providers;

use App\Service\Alarm;
use League\Container\ServiceProvider\AbstractServiceProvider;

class AppServiceProvider extends AbstractServiceProvider
{

    protected $provides = [
        'alarm'
    ];
    public function __construct()
    {
        echo "xx";
    }

    public function provides(string $id): bool
    {
        // TODO: Implement provides() method.
        return isset($this->provides[$id]) ? true : false;
    }


    public function register(): void
    {
        $this->getContainer()->add('alarm', new Alarm());
    }
}